package com.csun.cmny.provider.dao;

import com.csun.cmny.provider.model.dto.life.LifeRoomIndexDto;
import com.csun.cmny.provider.model.dto.life.LifeRoomQueryDto;
import com.csun.cmny.provider.model.vo.LifeRoomBuildingVo;
import com.csun.cmny.provider.model.vo.RoomBuildingVo;
import com.csun.cmny.provider.model.vo.RoomInfoLifeVo;
import com.csun.cmny.provider.model.vo.RoomInfoVo;
import com.csun.cmny.provider.model.vo.life.LifeIndexRoomVO;
import com.csun.cmny.provider.model.vo.life.LifeRoomVO;
import com.csun.cmny.provider.pojo.Room;
import com.csun.cmny.provider.vo.RoomSleepInfo;
import com.csun.cmny.provider.vo.RoomWithOtherVo;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public interface RoomMapper {
    int deleteByPrimaryKey(Integer roomId);

    int insert(Room record);

    int insertSelective(Room record);

    Room selectByPrimaryKey(Integer roomId);

    int updateByPrimaryKeySelective(Room record);

    int updateByPrimaryKey(Room record);

    Long isBindBodySensorByRoomId(Integer roomId);

    /**
     * 查询房间信息
     * author:liqian
     * date:2018-11-12 15:30
     */
    List<Room> showAll(Map<String, Object> queryMap);

    /**
     * 查询该楼栋的信息(床位编号方式:1 按房间计数 2 按楼层计数)及房间信息
     * author:liqian
     * date:2018-11-12 16:47
     */
    Map<String, Object> selectBuildingAndRoom(Integer roomId);

    /**
     * 根据room尝试下room
     * author:liqian
     * date:2018-11-13 11:13
     */
    Room selectByRoom(Room room);

    /**
     * 根据楼栋id和楼层号查询出该层床位号最大的床位号
     * author:liqian
     * date:2018-11-13 13:29
     */
    List<Map<String, Object>> selectByBidAndFno(@Param("buildingId") Integer buildingId, @Param("floorNo") Integer floorNo);

    /**
     * 根据楼栋id和楼层号查询房间及床位
     * author:liqian
     * date:2018-11-13 16:00
     */
    List<Room> selectRooms(Room room);

    /**
     * 根据房间id查询房间信息——包含床位信息
     * author:liqian
     * date:2018-11-14 14:44
     */
    Room selects(Integer roomId);

    /**
     * query room building list
     *
     * @param roomIdList room id list
     * @return the list.
     */
    List<RoomBuildingVo> queryRoomBuildingList(@Param("roomIdList") List<Integer> roomIdList);

    /**
     * query room building by room id
     *
     * @param roomId room id
     * @return room building vo
     */
    RoomBuildingVo queryRoomBuildingByRoomId(Integer roomId);

    /**
     * 查询房间记录数量
     *
     * @param roomCheck
     * @return
     */
    int selectCountRoom(Room roomCheck);

    /**
     * 根据楼栋、楼层查询房间信息
     *
     * @param: [buildingId, floorNo]
     * @return: java.util.List<com.csun.cmny.provider.model.vo.RoomInfoVo>
     */
    List<RoomInfoVo> queryRoomInfo(@Param("buildingId") Integer buildingId, @Param("floorNo") Integer floorNo,@Param("roomId") Integer roomId);

    /**
     * 查询房间入住人数
     *
     * @param: [roomId]
     * @return: java.lang.Integer
     */
    Integer queryRoomCheckInNum(@Param("roomId") Integer roomId);

    /**
     * 根据楼栋id和楼层号查询房间及床位和其它信息
     * author:chenzheng
     * date:2019-09-05
     */
    List<RoomWithOtherVo> selectRoomsWithOther(Room room);

    List<RoomInfoLifeVo> queryRoomLifeInfo();

    Long selectOldByRoomId(Long roomId);

    /**
     * life集团分页查询
     * @date 2019/12/31 11:42
     * @param lifeRoomQuertDto
     * @return com.csun.cmny.provider.dao.RoomMapper
     */
    List<LifeRoomVO> queryListWithPage(LifeRoomQueryDto lifeRoomQuertDto);

    /*life首页根据楼栋id查询房间列表*/
    List<LifeIndexRoomVO> queryIndexRooms(LifeRoomIndexDto lifeRoomQuertDto);

    /*life根据房间id查询详细信息*/
    List<LifeIndexRoomVO> lifeRoom(@Param("roomId") Long roomId,@Param("groupId") Long groupId);

    /**
     * 根据roomId查询Life房间详情
     * @date 2020/1/6 9:36
     * @param intValue
     * @return com.csun.cmny.provider.dao.RoomMapper
     */
    LifeRoomVO getLifeRoomById(@Param("roomId") int intValue);
    /**
     * 查询所有未入住的房间
     * @param lifeRoomQuertDto
     * @return
     */
    List<LifeRoomVO> notLifeRooms(LifeRoomQueryDto lifeRoomQuertDto);

    /*
    * 根据机构id查询房间
    * */
    List<LifeRoomBuildingVo> listRoomByGroupId(LifeRoomQueryDto dto);
    /**
     * 守护佳个人床垫数据
     * @return Wrapper
     * @author HD
     * @date 2021/12/16 10:08
     */
    List<RoomSleepInfo> roomSleepInfo(@Param("groupId") Long groupId);

    List<RoomSleepInfo> queryRoomSleepInfo(@Param("ids") ArrayList<Long> ids);

    List<RoomSleepInfo> selectOldmanSex(@Param("ids") ArrayList<Long> ids);
}